package com.econ.powercloud.ems.common.enums;

/**
 * @Author : zjf
 * @Description : 阿里云上传文件的类型
 * @Date : 2021/8/10 15:56
 * @Modified by : zjf
 */
public enum OSSPathType {

    OTHER(0,"other"),
    SVG(1,"svg");

    private int code;
    private String desc;

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    OSSPathType(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getCodeFromCode(int code){
        for(OSSPathType type: OSSPathType.values()){
            if(type.getCode() == code){
                return type.getDesc();
            }
        }
        return OSSPathType.OTHER.desc;
    }
}
